package dataStructure;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class LinkList {
    static class LNode{
        int data;
        LNode next;
        public LNode LinkList_headInsert(ArrayList<Integer> list) {
            LNode L = new LNode();
            L.next = null;
            for (Integer i : list) {
                LNode s = new LNode();
                s.data = i;
                s.next = L.next;
                L.next = s;
            }
            return L;
        }

        public LNode LinkList_tailInsert(ArrayList<Integer> list) {
            LNode L = new LNode();
            L.next = null;
            LNode rear = L;
            for (Integer i : list) {
                LNode s = new LNode();
                s.data = i;
                s.next = rear.next;
                rear.next = s;
                rear = s;
            }
            return L;
        }
        public LNode get(LNode L,int locate){
            LNode p = L.next;
            for (int i = 0; i < locate; i++) {
                p = p.next;
            }
            return p;
        }

    }
    public static void main (String[] args){
        List<Integer> list = new LinkedList<>();


    }


}
